package com.xmut.mall.store.controller;

import com.xmut.mall.store.service.IndexStatisticsService;
import com.xmut.mall.store.utils.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("store/statistics")
public class StoreIndexController {

    @Autowired
    private IndexStatisticsService indexStatisticsService;

    /**
     * 根据店铺ID获取店铺的首页数据
     * @param storeId
     * @return
     */
    @GetMapping("/index/{storeId}")
    public RespBean getStoreIndex(@PathVariable Long storeId){
        return indexStatisticsService.getStoreIndex(storeId);
    }
}
